<template>
    <Layout style="background-color: #fff;">
        <Upload :action="action" :headers="header">
            <Button type="primary" icon="ios-cloud-upload-outline">上传文件</Button>
        </Upload>
    </Layout>
</template>

<script>
export default {
  name: 'upload-file',
  props: {
    url: '',
    text: '上传文件'
  },
  data () {
    return {
      action: '//jsonplaceholder.typicode.com/posts/',
      header: { 'Content-Type': 'multipart/form-data' }
    }
  },
  created () {
    this.$nextTick(() => {
      // this.init();
    })
  },
  methods: {
    init () {
      this.timer = setInterval(() => {
        if (this.percent < 80) {
          this.percent++
        } else {
          // clearInterval(this.timer);
          // this.percent=100;
        }
      }, 100)
    },
    conurl () {
      return this.axios.request({
        url: 'aaa',
        method: 'get'
      })
        .then(res => {
          console.log(res)
        })
        .catch(err => {
          console.log(err)
        })
    }
  }
}
</script>

<style lang="less">
</style>
